<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'login-form',
    'type'=>'horizontal',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>
	<p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>

	<?php echo $form->errorSummary(array($model,$profile)); ?>
	<?php echo $form->textFieldRow($profile,'firstname',array('class'=>'form-control span5')); ?>
	<?php echo $form->textFieldRow($profile,'lastname',array('class'=>'form-control span5')); ?>
	<?php echo $form->textFieldRow($model,'username',array('class'=>'form-control span5')); ?>
	<div class="control-group">
		<label for="User_password" class="control-label">password</label>
		<div class="controls">
			<input type="password" value="" maxlength="128" id="User_password" name="User[password]" placeholder="password" class="form-control span5">
			<div style="display:none" id="User_password_em_" class="errorMessage"></div>
		</div>
	</div>
	<?php echo $form->textFieldRow($model,'email',array('class'=>'form-control span5')); ?>
	<?php echo $form->dropDownListRow($model,'superuser',User::itemAlias('AdminStatus'),array('class'=>'form-control span3')); ?>
	<?php echo $form->dropDownListRow($model,'status',User::itemAlias('UserStatus'),array('class'=>'form-control span3')); ?>
	<?php 
		Rights::getAuthItemSelectOptions(2); 
		$role = Yii::app()->helper->getRole($model->id);
	?> 
	<?php $all_roles=new RAuthItemDataProvider('roles', array('type'=>2,));$data=$all_roles->fetchData();?>
	<div class="control-group">
		<label for="role" class="control-label required">Role </label>
		<div class="controls">
			<?php echo CHtml::dropDownList("typeRole",'',CHtml::listData($data,'name','name'),array('class'=>'form-control span3','empty'=>'--Select Role--','options' => array($role=>array('selected'=>true))));?> 
		</div>
	</div>
	<div class="form-actions">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'submit',
            'type'=>'primary',
            'label'=>$model->isNewRecord ? 'Create' : 'Save',
        )); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->